<!DOCTYPE html>
<html lang="zh-cn" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>学生住宿管理系统</title>
    <!--导入网页图标 -->
    <link rel="icon" href="../static/favicon.ico" th:href="@{/favicon.ico}" type="image/x-icon">
    <!--导入网页图标 -->
    <link rel="shortcut icon" href="../static/favicon.ico" th:href="@{/favicon.ico}" type="image/x-icon">
    <!--导入layUI css库 -->
    <link rel="stylesheet" href="../static/lib/layui/css/layui.css" th:href="@{/lib/layui/css/layui.css}" media="all">
    <style>
        html {
            margin: 0;
            padding: 0;
            border: 0;
            width: 100%;
            height: 100%;
        }

        body {
            float: none;
            margin: 0;
            padding: 0;
            border: 0;
            position: fixed;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            background: url() no-repeat;
            background-size: cover;
        }

        @media screen and (max-width: 600px) {
            .login_div {
                background-color: rgba(0, 0, 0, 0);
            }
        }

        @media screen and (min-width: 600px) {
            .login_div {
                background-color: rgba(0, 0, 0, 0.1);
            }
        }

        .login_div {
            float: none;
            margin-top: 160px;
            margin-left: auto;
            margin-right: auto;
            padding-top: 40px;
            width: 375px;
            height: 240px;
            border-radius: 3px;
        }

        .login_item_div {
            padding: 0;
            margin-left: auto;
            margin-right: auto;
            width: 300px;
        }

        .login_item_div input {
            width: 290px;
            height: 30px;
            border: 0;
            padding: 0 0 0 10px;
            margin-top: 20px;
            outline: none;
            border-bottom: 1px solid rgb(73, 108, 122);
            border-radius: 1px;
            background-color: rgba(240, 238, 238, 0);
            color: oldlace;
        }

        input::-webkit-input-placeholder {
            color: #e9e9e9;
        }

        input::-moz-input-placeholder {
            color: #e9e9e9;
        }

        input::-ms-input-placeholder {
            color: #e9e9e9;
        }

        .login_item_div input[type="submit"] {
            cursor: pointer;
            width: 300px;
            padding-right: 10px;
            border: 0;
            background-color: rgba(25, 73, 90, 0.6);
            color: rgb(255, 255, 255);
        }

        .login_item_div input[type="submit"]:hover {
            background-color: #0a4b63;
        }

        .system_name {
            color: white;
            font-size: 30px;
            text-align: center;
        }

        .msg {
            color: red;
            font-size: 20px;
            margin-top: 20px;
        }
    </style>
</head>

<body>
<form method="post" action="#" th:action="@{/login-auth}">
    <div class="login_div">
        <div class="login_item_div system_name">
            <label>学生住宿管理系统</label>
        </div>
        <div class="login_item_div">
            <label for="username">
                <input id="username" name="username" type="text" value=""
                       th:value="${#strings.isEmpty(username)?'':username}" placeholder="请输入用户名">
            </label>
        </div>
        <div class="login_item_div">
            <label for="password">
                <input id="password" name="password" type="password" value=""
                       th:value="${#strings.isEmpty(password)?'':password}" placeholder="请输入密码">
            </label>
        </div>
        <div class="login_item_div">
            <label for="submit">
                <input id="submit" name="submit" type="submit" value="登 录">
            </label>
        </div>
    </div>
    <div hidden id="info" th:text="${#strings.isEmpty(info)?'':info}"></div>
    <div hidden id="error" th:text="${#strings.isEmpty(error)?'':error}"></div>
</form>
<!--导入layUI库 -->
<script type="text/javascript" src="../static/lib/layui/layui.js" th:src="@{/lib/layui/layui.js}"></script>
<script type="text/javascript">
    layui.use('layer', function () {
        var layer = layui.layer;
        var $ = layui.$;
        var $error = $("#error");
        if ($error.text() !== "") {
            layer.msg($error.text(), {icon: 2, offset: 't', time: 2000});
        }
        var $info = $("#info");
        if ($info.text() !== "") {
            layer.msg($info.text(), {icon: 1, offset: 't', time: 2000});
        }
    });
</script>
</body>

</html>